/*
 *  ATrackRef.cpp
 *  libavid
 *
 *  Created by Peter on 25.02.12.
 *  Copyright 2012 __MyCompanyName__. All rights reserved.
 *
 */

#include "ATrackRef.h"
#include "AStream.h"

A_IMPLEMENT_CLASS( 'TRKR', ATrackRef, AClip );

void ATrackRef::readFromStream( AStream& str, const AObjDoc& objd )
{
	AClip::readFromStream( str, objd );
	
	UInt8 tagMark, version;
	
	str.readPod( tagMark );
	str.readPod( version );
	
	str.readPod( _relativeScope ); // OMFI:TRKR:RelativeScope: 1
	str.readPod( _relativeTrack ); // OMFI:TRKR:RelativeTrack: -1
	
	str.readPod( tagMark );
	TR_ASSERT( tagMark == 0x03 );
}

void ATrackRef::dump( std::ostream& str ) const
{
	str << "ATrackRef {" << std::endl;
	
	str << "\t";
	AClip::dump( str );
	
	str << "_relativeScope: " << _relativeScope << std::endl;
	str << "_relativeTrack: " << _relativeTrack << std::endl;
	
	str << "}" << std::endl;
}